package com.noahsloan.nutils.bytes;

import java.io.IOException;

/**
 * Exception thrown when a byte sequence could not be found in an InputStream
 * before the EOS. A call to getRemainder will return all the bytes read up to
 * the End Of Stream (if any).
 * 
 * @author Noah Sloan
 */
public class DelimeterNotFoundException extends IOException {

    private static final long serialVersionUID = -2735622976548252176L;

    private byte[] remainder;

    /**
     * 
     * @param remainder
     *            all bytes read before the EOS was encountered.
     */
    public DelimeterNotFoundException(byte[] remainder) {
        super();
        this.remainder = remainder;
    }

    /**
     * 
     * @return the remainder
     */
    public byte[] getRemainder() {
        return remainder;
    }
}
